#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;
using WaveMaster.Holidays.Club.Service;
using System.Configuration;
using WaveMaster.Holidays.Club.Domain;

#endregion

namespace WaveMaster.Holidays.Club.Web
{
    public partial class PrintReceiptForm : Form
    {
        TicketPurchaseService m_ticketPurchaseService;

        public PrintReceiptForm(long id, User m_currentUser)
        {
            InitializeComponent();
            m_ticketPurchaseService = new TicketPurchaseService();// (TicketPurchaseService)ServiceFactory.Instance().GetService(ServiceFactory.TICKET_PURCHASE_SERVICE);

            DataSet result = m_ticketPurchaseService.ReportTicketPurchaseByID(id);
            result.WriteXml(ConfigurationManager.AppSettings["ReportDataTemp"] + "TicketPurchaseReceiptReport" + m_currentUser.UserID + ".xml", XmlWriteMode.WriteSchema);
            htmlBox1.Url = ConfigurationManager.AppSettings["URLReport"] + "ReportViewer.aspx?ReportDataSource=TicketPurchaseReceiptReport" + m_currentUser.UserID + ".xml&ReportFile=TicketPurchaseReceiptReport.rpt";
            htmlBox1.Update();

            //result.WriteXml(@"D:\Others\Projects\WavemasterHolidaysClub\TicketPurchaseReceiptReport.xml", XmlWriteMode.WriteSchema);
            //string reportID  = ServiceFactory.GenerateRandomID().ToString();
            //Session["ReportReceiptTicketPurchaseData" + reportID] = result;
            //Session["ReportReceiptTicketPurchaseFile" + reportID] = "TicketPurchaseReceiptReport.rpt";
            //string param1 = "ReportDataSource=ReportReceiptTicketPurchaseData" + reportID;
            //string param2 = "ReportFile=ReportReceiptTicketPurchaseFile" + reportID;
            //htmlBox1.Url = ConfigurationManager.AppSettings["URLReport"] + "ReportViewer.aspx?" + param1 + "&" + param2;
            ////htmlBox1.Url = "http://" + this.Context.HttpContext.Request.ServerVariables["SERVER_NAME"] + ":" + this.Context.HttpContext.Request.ServerVariables["SERVER_PORT"] + @"/Report/" + "ReportViewer.aspx?" + param1 + "&" + param2;
            //htmlBox1.Update();
        }
    }
}